<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<title>教师列表</title>
<c:import url="/WEB-INF/jsp/head.jsp" />
<link rel="stylesheet"
	href="static/css/bootstrap-datetimepicker.min.css">
<script type="text/javascript"
	src="static/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
	src="static/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript" src="static/js/teacher/list.js"></script>
</head>
<body>
	<div class="default-theme container-fluid iframe">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">搜索条件</div>
				<div class="panel-body">
					<form class="form-inline" action="teacher/list" method="post">
						<div class="form-group">
							<label for="name">教师名称:</label> <input type="text"
								class="form-control" name="name" value="${nameValue }" />
						</div>
						<div class="form-group">
							<label for="type.value">教师类型：</label> <select name="type.value"
								class="form-control">
								<option value="">所有</option>
								<c:forEach items="#{types }" var="type">
									<option value="${type.value }"
										<c:if test="${typeValue == type.value }">selected="selected"</c:if>>${type.name }</option>
								</c:forEach>
							</select>
						</div>
						<input type="hidden" id="pageNum" name="pageNum" />
						<button type="submit" class="btn btn-default">搜索</button>
					</form>
				</div>
			</div>
		</div>
		<div class="col-md-12">
			<table class="table table-hover table-border">
				<thead>
					<tr>
						<th style="min-width: 6.1rem">教师编号</th>
						<th style="min-width: 6.1rem">教师名称</th>
						<th style="min-width: 6.1rem">教师类型</th>
						<th style="min-width: 11rem">联系电话</th>
						<th style="min-width: 11rem">电子邮箱</th>
						<th style="min-width: 13rem;">备注</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(pageInfo.list) == 0 }">
						<tr align="center">
							<td colspan="7">没有查询到数据</td>
						</tr>
					</c:if>
					<c:forEach items="${pageInfo.list }" var="item">
						<tr>
							<td>${item.id }</td>
							<td><a data-title="教师详情" href="teacher/info?id=${item.id }">${item.name }</a>
							</td>
							<td>${item.type.name }</td>
							<td>${item.tel }</td>
							<td><span class="hide-content">${item.email }</span></td>
							<td><span class="hide-content">${item.remarks }</span></td>
							<td><a
								href="teacher/edit?id=${item.id }&teacherName=${nameValue }&typeValue=${typeValue }&pageNum=${pageInfo.pageNum }&pageSize=${pageInfo.pageSize }"
								type="button" data-title="编辑教师" class="btn btn-primary btn-sm">
									<span class="glyphicon glyphicon-pencil" aria-hidden="true">
										编辑</span>
							</a></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<c:import url="/WEB-INF/jsp/paging.jsp" />
		</div>
	</div>
</body>
</html>